package handler

import (
	"github.com/gin-gonic/gin"
	"post-hub/internal/dto"
	"post-hub/internal/model"
	"post-hub/response"
)

func PostList(c *gin.Context) {

	var post []model.Post
	err := c.ShouldBind(&post)
	if err != nil {
		response.Error(c, "解析失败")
		return
	}
	err = dto.PostList(&post)
	if err != nil {
		response.Error(c, "查询失败")
		return
	}
	response.Success(c, "查询成功", post)
}
